package com.swizipuremvc.app.user.services
{
	import com.swizipuremvc.app.user.services.interfaces.IDashboardService;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.Fault;
	
	import org.swizframework.utils.services.MockDelegateHelper;
	
	public class DashboardMockupService implements IDashboardService
	{
		private var mockHelper:MockDelegateHelper = new MockDelegateHelper();
		
		public function authenticateUser(user:String,password:String):AsyncToken
		{
			mockHelper.showBusyCursor = true;
			var obj:Object = new Object();
			obj.userName = user;
			obj.password = password;
			
			if(user == 'durrab' && password == 'khan')
			{
				return mockHelper.createMockResult(new Object(),5000);
			}
			else
			{
				return mockHelper.createMockFault(new Fault("error","username or password is incorrect","Either your username or password is incorrect"),5000);
			}
		}
	}
}